#include<iostream>
#include<vector>
#include<map>

using namespace std;

string minWindow(string s, string t) {
    map<char, int> m;
    for (auto it : t)    m[it]++;
    int begin = -1, len = s.size() + 1;
    int l = 0, cnt = m.size();
    for (int r = 0; r < s.size(); r++)
    {
        m[s[r]]--;
        if (m[s[r]] == 0)    cnt--;
        while (cnt == 0)
        {
            if (r - l + 1 < len)
                begin = l, len = r - l + 1;
            if (m[s[l]] == 0)    cnt++;
            m[s[l]]++;
            l++;
        }
    }
    if (begin == -1) return "";
    return s.substr(begin, len);
}